function template(id, obj) {
  let str = document.getElementById(id).innerHTML
  let pattern = /{{\s*([a-zA-Z]+)\s*}}/

  let pattResult = null
  while (pattResult = pattern.exec(str)) {
    console.log(pattResult);
    str = str.replace(pattResult[0], obj[pattResult[1]])
  }
  return str
}